# coding=utf8
# 全世界最帅的帅哥
from flask_restful import Api
from flask import Blueprint
from comment.utils.output import output_json

# 创建蓝图
user_bp = Blueprint('user', __name__, url_prefix='/user')
# 创建蓝图中的资源Api
user_api = Api(user_bp)

# 使用定制好的格式返回给前端的json格式
user_api.representation("application/json")(output_json)

from .user_resources import Login, IsExistPhone, SmsCode, Register, LoginOut, UserAvatar, InviteCode, UserInfo, \
    EmailMessageCode, PayPassword, LoginPwd, RealNameAuth

user_api.add_resource(Login, "/login", endpoint="login")
user_api.add_resource(IsExistPhone, "/isExist", endpoint="is_exist_phone")
user_api.add_resource(SmsCode, "/sms", endpoint="sms")
user_api.add_resource(Register, "/register", endpoint="register")
user_api.add_resource(LoginOut, "/login_out", endpoint="login_out")
user_api.add_resource(UserAvatar, "/avatar", endpoint="avatar")
user_api.add_resource(InviteCode, "/invite_code", endpoint="invite_code")
user_api.add_resource(UserInfo, "/user_info", endpoint="user_info")
user_api.add_resource(EmailMessageCode, "/email", endpoint="email")
user_api.add_resource(PayPassword, "/pay_password", endpoint="pay_password")
user_api.add_resource(LoginPwd, "/login_pwd", endpoint="login_pwd")
user_api.add_resource(RealNameAuth, "/real_name", endpoint="real_name")

